{layout name="layout" $title/}
<div class="col-md-9">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">设计文件信息</h3>
    </div>
    <div class="panel-body">
      <table class="table table-striped .table-bordered  table-hover">
        <tr class="info">
          <th class="text-right col-md-4">属性</td>
          <th class="">参数</td>
        </tr>
        <tr>
          <td class="text-right">编号</td>
          <td class="">{$document.code}</td>
        </tr>
        <tr>
          <td class="text-right">名称</td>
          <td class="">{$document.title}</td>
        </tr>
        <tr>
          <td class="text-right">增加记录Code</td>
          <td class="">{$document.create_code}</td>
        </tr>
        <tr>
          <td class="text-right">增加记录姓名</td>
          <td class="">{$document.create_name}</td>
        </tr>
        <tr>
          <td class="text-right">增加记录时间</td>
          <td class="">{$document.create_time}</td>
        </tr>
        <tr>
          <td class="text-right">增加时间,工作日</td>
          <td class="">{$document.create_time}</td>
        </tr>
        <tr>
          <td class="text-right">更新记录时间</td>
          <td class="">{$document.update_time}</td>
        </tr>
        <tr>
          <td class="text-right">更新-增加,时间差</td>
          <td class="">{$document.delta_time}</td>
        </tr>
        <tr>
          <td class="text-right">详细内容</td>
          <td class="">{$document.detail}</td>
        </tr>
        <!-- 注:此段为演示用,并无数据来源 ↓ -->
        <tr>
          <td class="text-right">费用</td>
          <td class=""><span class="glyphicon glyphicon-yen" aria-hidden="true"></span>500</td>
        </tr>
        <!-- 注:此段为演示用,并无数据来源 ↑ -->
        <tr>
          <td class="text-right">是否某事物</td>
          <td class="">{$document.is_sth}</td>
        </tr>
        <tr>
          <td class="text-right">某事物数量</td>
          <td class="">{$document.sth_num_unit}</td>
        </tr>
        <tr>
          <td class="text-right">状态</td>
          <td class="">{$document.static_text}</td>
        </tr>
        <tr>
          <td class="text-right">图片</td>
          <td><img src="{:url('/uploads/'.$document.pic_name)}" class="img-responsive img-thumbnail" alt="暂无照片..."></td>
        </tr>
      </table>
      <div class="panel-group" role="tablist">
				<div class="panel panel-default">
					<div class="panel-heading" role="tab" id="collapseListGroupHeading2">
							<a class="collapsed" role="button" data-parent="#accordion"  href="#collapseListGroup2" aria-expanded="true" aria-controls="collapseListGroup2">
								CAP1400文件 <span class="badge">{$documentProcessNum}</span>
							</a>
					</div>
					<div id="collapseListGroup2" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="collapseListGroupHeading2">
            <table class="table table-condensed">
              <thead>
                <tr>
                  <th>序号</th>
                  <th>阶段</th>
                  <th>处理人</th>
                  <th>流程开始时间</th>
                  <th>处理时间</th>
                  <th>处理意见</th>
                  <th>下一位</th>
                </tr>
              </thead>
              <tbody>
                {volist name="documentProcess" id="Process"}
                <tr class="{$Process.execute_code==$Request.cookie.login_code?='danger'}">
                  <th scope="row">{$i}</th>
                  <td>{$Process.process_static_title}</td>
                  <td>{$Process.execute_title}</td>
                  <td>{$Process.create_time}</td>
                  <td>{$Process.update_time}</td>
                  <td>{$Process.execute_opinion}</td>
                  <td>{$Process.next_execute_code}</td>
                </tr>
                {/volist}
              </tbody>
            </table>
            <br>
            <form class="form-horizontal" method="post" class="post" action="{:url('office/document/update_process','id='.$document.id)}" enctype="multipart/form-data">
              <h4 class='text-center'>{$document.static_text}阶段</h4>
              <input type="hidden" name="process[document_code]"  value="{$document.code}">                <!-- 此处为向后台传递的document_code -->
              <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">Code</label>
                <div class="col-sm-10">
                  <input type="text" name="process[execute_code]" class="form-control" id="inputEmail3" placeholder="code" value="{$Request.cookie.login_code}" readonly>
                </div>
              </div>
              <div class="form-group">
                <label for="inputPassword3" class="col-sm-2 control-label">姓名</label>
                <div class="col-sm-10">
                  <input type="text" name="process[execute_title]" class="form-control" id="inputPassword3" placeholder="Password" value="{$Request.cookie.login_name}" readonly>
                </div>
              </div>
              <div class="form-group">
                <label for="inputPassword3" class="col-sm-2 control-label">部门</label>
                <div class="col-sm-10">
                  <input type="text" name="" class="form-control" id="inputPassword3" placeholder="部门..." readonly value="">
                </div>
              </div>
              <div class="form-group">
                <label for="inputPassword3" class="col-sm-2 control-label">意见</label>
                <div class="col-sm-10">
                  <TEXTAREA name="process[execute_opinion]" class="form-control" rows="4" id="inputPassword3"  placeholder="请填写意见..." >{volist name="saveProcess" id="save"}{$save.execute_opinion}{/volist}</TEXTAREA>
                </div>
              </div>
              <div class="form-group">
                <label for="inputPassword3" class="col-sm-2 control-label">下一阶段</label>
                <div class="col-sm-10">
                  <input type="text" name="" class="form-control" id="inputPassword3" placeholder="下一阶段..." value="{$document.next_static_text}" readonly>
                </div>
              </div>
              <div class="form-group">
                <label for="inputPassword3" class="col-sm-2 control-label">下一阶段处理人</label>
                <div class="col-sm-10">
                  <select name="process[next_execute_code]" class="form-control">
                    <option value='' >--请选择--</option>
                    <option value='{$document.create_code}' >编制人员</option>
                      {volist name="nextProcessId" id="selectList" }
                      <optgroup label="{$selectList.depart}">
                        {volist name="selectList.member" id="select" }
                        <option value="{$select.code}" {volist name="saveProcess" id="save"}{$save.next_execute_code==$select.code?="selected"}{/volist}>{$select.code}:{$select.title}</option>
                        {/volist}
                      </optgroup>        
                      {/volist}
                  </select>
                </div>
              </div>
              <input type="hidden" name="process[process_static]"  value="{$document.static}">             <!-- 此处为向后台传递的process_static -->
              <input type="hidden" name="process[process_static_title]"  value="{$document.static_text}">  <!-- 此处为向后台传递的process_static_title -->
              <input type="hidden" name="process[next_process_static]"  value="{$document.next_static}" > <!-- 此处为向后台传递的next_static -->
              <div class="form-group">
                <div class="col-sm-offset-2 col-sm-8 text-center">
                  <button type="submit" name='decide' value="0" class="btn btn-primary">保  存 <span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span></button>
                  <button type="submit" name='decide' value="-1" class="btn btn-danger" {$document.static==1?="disabled"}>退  回 <span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span></button>
                  <button type="submit" name='decide' value="1" class="btn btn-success">通  过 <span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span></button>
                  <button type="submit" name='decide' value="-5" class="btn btn-gray">删  除 <span class="glyphicon glyphicon-arrow-up" aria-hidden="true"></span></button>
                </div>
              </div>
            </form>

					</div>
				</div>
			</div>

      <div class="text-center">
        <a href="{:url('office/document/index')}"  class="btn btn-info">返  回 <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span></a>
        <a href="{:url('office/document/read','id='.$document.id)}"  class="btn btn-info">查  看 <span class="glyphicon glyphicon-arrow-left" aria-hidden="true"></span></a>
      </div>
    </div>
  </div>
</div>